

import React,{ Component } from 'react';
import { Select,Input } from 'antd';
const Option = Select.Option;
const Search = Input.Search;


class Selects extends Component {
    constructor(props) {
        super(props);
        this.state = {
            show: 1,
        }
    }
    change(){
        this.setState({
            show: 0
        },()=>{
            console.log(this.state.show)
        })
    }
    onChange(value){
        console.log(value);
        this.setState({
            show:value
        })
    }
    render() {
        // let children = [];
        // for (let i = 10; i < 36; i++) {
        //     children.push(<Option key={i.toString(36) + i}>{i.toString(36) + i}</Option>);
        // }
        { console.log(typeof this.state.show)}
        return (
            <div>
                <button onClick={()=>this.change()}>change</button>
                <Select
                    onChange = { (value)=>this.onChange(value)}
                    value = { this.state.show }
                    style={{ width: 120 }}
                >
                  <Option value={0}>Jack</Option>
                  <Option value={1}>Lucy</Option>
                </Select>
            </div>
        )
    }

}

export default Selects;